package org.NooLab.itexx.storage.docserver.storage;

import java.util.ArrayList;
import java.util.Collection;




public class ObservedDocuments {

	ArrayList<ObservedDocument> docs = new ArrayList<ObservedDocument>();
	
	
	// ------------------------------------------------------------------------
	public ObservedDocuments(){
		
	}
	// ------------------------------------------------------------------------	
	
	public ArrayList<ObservedDocument>  getItems(){
		return docs;
		
	}

	public void add( long did, String filepath) {
		 
		ObservedDocument od = new ObservedDocument() ;
		
		od.docId = did;
		od.docname = filepath ;
		
		docs.add(od) ;
	}

	public int size() {
		
		return docs.size();
	}

	public void remove(int index) {
		
		docs.remove(index) ;
	}

	public void clear() {
		docs.clear();
		
	}

	public ObservedDocument get(int index) {
		ObservedDocument od ;
		od = docs.get(index) ;
		return od;
	}

	public String getFilename(int index) {
		ObservedDocument od ; 
		od = docs.get(index) ;
		return od.docname ;
	}

	public long getDocId(int index) {
		ObservedDocument od ;
		od = docs.get(index) ;
		return od.docId;
	}

	public ArrayList<String> getAllNames() {
		ArrayList<String> fnames = new ArrayList<String>();
		
		return fnames;
	}

	public void addAll(ObservedDocuments inDocs) {
		
		ArrayList<ObservedDocument> _docs = new ArrayList<ObservedDocument>();
		
		for (int i=0;i<inDocs.size();i++){
			_docs.add( inDocs.get(i) ) ;
		}
		docs.addAll( _docs) ;
	}

}
